<script>
var content_i=0;
function appendExtend($box,replaceStr){
	return $($.parseHTML($('#ex_new').text().replace(eval("/_new_/gi"),replaceStr), document, true)).appendTo($box);
}
function prependExtend($box,replaceStr){
	return $($.parseHTML($('#ex_new').text().replace(eval("/_new_/gi"),replaceStr), document, true)).prependTo($box);
}
<#if (contentAttr?has_content&&contentAttr.text?has_content)>
$(function(){
	<#list contentAttr.text?eval as a>
	$temp=appendExtend($('#ex_content',navTab.getCurrentPanel()),'_c_'+(content_i++)+'_');
	$('input',$temp).val('${(a.name?js_string)!}');
	$('textarea',$temp).val('${(a.text?js_string)!}');
	$temp.initUI();
	</#list>
});
</#if>
</script>
<#assign extendHtml>
<div style="clear:both">
	<label>片段<@t.m 'field.name'/>：</label>
	<input class="required" name="ex_new_name" maxlength="20" type="text" size="10"/>
	<a class="buttonActive" href="javascript:;" onclick="$('input[name=ex_new_name]',navTab.getCurrentPanel()).parent().remove();return false;"><span><@t.m 'button.delete'/></span></a>
	<div style="clear:both"></div>
	<textarea name="ex_new_text" class="required editor" style="width: 100%;" rows="20"></textarea>
	<hr/>
</div>
</#assign>
<textarea id="ex_new" style="display:none">${extendHtml?html}</textarea>
<dl class="nowrap">
	<dt>内容片段</dt>
	<dd>
		<a class="buttonActive" href="javascript:;" onclick="prependExtend($('#ex_content',navTab.getCurrentPanel()),'_c_'+(content_i++)+'_').initUI();return false;"><span>增加片段</span></a>
		<div id="ex_content"></div>
	</dd>
</dl>